<?php
header('Content-Type: text/xml');
include("../common/connect.php");
$phonenumber="";
$query="";
if (isset($_GET['phonenumber'])){
	$phonenumber=$_GET['phonenumber'];
	$query="select * from gLocation where phoneNumber='$phonenumber';";
}else{
	$query="select * from gLocation where 1 LIMIT 0 , 30;";
}
	
$result = mysql_query($query) or die("Query failed");
 
$xml="";
while($arrRow = mysql_fetch_assoc($result)){
    $xml .= "<union_data>\n";
    $xml .= "<latitude>".$arrRow["latitude"]."</latitude>\n";
    $xml .= "<longtitude>".$arrRow["longtitude"]."</longtitude>\n";
    $xml .= "<createTime>".$arrRow["createTime"]."</createTime>\n";
    $xml .= "</union_data>\n";
}
//echo $xml;
//exit;
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
echo "<data>\n";
echo $xml;
echo "</data>";
?>